<form class="layui-form pt10" action="{:url('edit')}" method="post" id="editForm">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">会员</label>
            <div class="layui-input-inline">
                <select name="user_id" class="layui-input field-user_id" disabled lay-verify="required" >
                  {$users|raw}
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">操作单号</label>
            <div class="layui-input-inline">
                <input type="text"  class="layui-input field-sn" name="sn" readonly lay-verify="" autocomplete="off" ">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">房间</label>
            <div class="layui-input-inline">
                <select name="room_id" class="layui-input field-room_id" lay-verify="required" lay-search="">
                  <option value="">直接选择或搜索选择</option>
                  {$rooms|raw}
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">顾问</label>
            <div class="layui-input-inline">
                <select name="adviser_id" class="layui-input field-adviser_id" lay-verify="required" lay-search="">
                  <option value="">直接选择或搜索选择</option>
                  {$advisers|raw}
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">收银备注</label>
            <div class="layui-input-inline">
                 <textarea class="layui-textarea field-remarks" name="remarks" readonly lay-verify="content"></textarea>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">皮肤现状</label>
            <div class="layui-input-inline">
                <textarea class="layui-textarea field-skin_text" name="skin_text"  lay-verify="content"></textarea>
            </div>
        </div>
    </div>


    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">需要解决的问题</label>
            <div class="layui-input-inline">
                 <textarea class="layui-textarea field-problem" name="problem"  lay-verify="content"></textarea>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">操作注意细节</label>
            <div class="layui-input-inline">
                <textarea class="layui-textarea field-operate_detail" name="operate_detail"  lay-verify="content"></textarea>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">建议居家用品</label>
            <div class="layui-input-inline">
                 <textarea class="layui-textarea field-sug_goods" name="sug_goods"  lay-verify="content"></textarea>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" >是否移交库管配料</label>
        <div class="layui-input-inline w200">
            <input type="radio" class="field-status" name="status" value="0" title="否" checked>
            <input type="radio" class="field-status" name="status" value="1" title="是">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" class="field-id" name="id">
        </div>
    </div>
    <div class="pop-bottom-bar hisi-footer">
        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit" hisi-data="{pop: true, refresh: true}">提交保存</button>
        <a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary ml10">取消</a>
    </div>
</form>
<hr>
<table id="dataTable"></table>
<!-- <script src="__PUBLIC_JS__/layui/xm-select.js" charset="utf-8"></script> -->
{include file="system@block/layui" /}
<script type="text/html" title="操作按钮模板" id="buttonTpl">
    <a href="{:url('SubscribeProject/edit')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-normal hisi-iframe-pop"  hisi-data="{width: '800px', height: '600px', title: '修改'}">修改</a>
    <a href="{:url('del')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-danger j-tr-del">删除</a>
</script>
<script id="toolbar" type="text/html">
    <a href="{:url('SubscribeProject/add')}?sub_id={$formData['id']}" class="layui-btn layui-btn-normal layui-btn-sm hisi-iframe-pop" hisi-data="{width: '800px', height: '600px', title: '添加'}">&nbsp;添加</a>
</script>
<script>

layui.use(['func','laydate','table'], function() {
    //常规用法
    var laydate = layui.laydate;
    laydate.render({
          elem: '#date',
          trigger:'click',
          type:'datetime'
        });
    layui.func.assign({:json_encode($formData)});

    var table = layui.table;
    table.render({
        elem: '#dataTable'
        ,url: '{:url('SubscribeProject/index')}?sub_id={$formData['id']}' //数据接口
        ,page: true //开启分页
        ,skin: 'row'
        ,even: true
        ,limit: 30
        ,text: {
            none : '暂无相关数据'
        }
        ,toolbar: '#toolbar'
        ,defaultToolbar: ['filter']
        ,cols: [[ //表头
            {type:'checkbox'}
            ,{field: 'projects', title: '项目名称'}
            ,{field: 'num', title: '数量'}
            ,{field: 'is_give', title: '是否赠送',templet:function(d){
                if(d.is_give == 1){
                    return '否';
                }else{
                    return '是';
                }
            }} //是否赠送:1=,2=是
            ,{field: 'price', title: '金额'}
            ,{field: 'type', title: '类型',templet:function(d){
                if(d.is_give == 1){
                    return '实操项目';
                }else{
                    return '特殊项目';
                }
            }} //项目分类:1=实操项目,2=特殊项目
            ,{field: 'adviser', width:80, title: '顾问'}
            ,{field: 'technician_ids', width:120, title: '美容师',templet:function(d){
                return d.technician;
            }}
            ,{field: 'bak', title: '备注'}
            ,{title: '操作', templet: '#buttonTpl'}
            ]]
            ,done: function(){
                if (typeof(layui.global.addTableTool) !== 'undefined') {
                    layui.global.addTableTool();
                }
            }
        });

});
</script>
